/*
 * ImagenesFilter.java
 *
 * Created on 19 de junio de 2006, 01:27 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package inc.jmc.cyberboard.common;
import javax.swing.filechooser.*;
import java.io.File;
/**
 *
 * @author Juan Miguel Olguin Salguero
 */
public final class ImagenesFilter extends FileFilter{
       public final boolean accept(File f)
                     {
                     boolean ret=false;
                     if(   (f.getName().toUpperCase().endsWith(".jpg")||
                             f.getName().toUpperCase().endsWith(".JPEG")||
                             f.getName().toUpperCase().endsWith(".jpeg")||
                             f.getName().toUpperCase().endsWith(".JPG")||
                             f.getName().toUpperCase().endsWith(".gif")||
                             f.getName().toUpperCase().endsWith(".GIF")||
                        f.isDirectory())
                        && (f.length()<2097152)
                        
                       )
                       ret=true;
                     return ret;
                     }

       public final String getDescription()
              {
              return "Imagenes [jpg,gif] menores de 2 Mb";
              }
}